import http from '@/utils/request'

/**
 * 账号登录
 */
export const userAccountLogin = ({
  account,
  password
}: {
  account: string
  password: string
}) =>
  http({
    url: '/login',
    method: 'post',
    data: { account, password }
  })

/**
 * 短信登录
 */
export const userMobileLogin = ({
  mobile,
  code
}: {
  mobile: string
  code: string
}) =>
  http({
    url: '/login/code',
    method: 'post',
    data: { mobile, code }
  })

/**
 * 获取短信登录验证码
 */
export const userMobileLoginMsg = (mobile: string) =>
  http({
    url: '/login/code',
    params: { mobile }
  })
